<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <div id="app">
            <input type="text" v-model.number="val">
            <h5>{{val}}</h5>
            <input type="text" v-model.trim="vals">
            <h5>{{vals}}</h5>
            <input type="text" v-model.lazy="valss">
            <h1>{{valss}}</h1>
     </div>
    <script src='https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js'></script>
    <script>
         //指令修饰符
         //number 将输入值转换为number
         //trim   去字符串开头和结尾的空格
         //lazy   相当于原生的change 事件
         
          const vm = new Vue({
            el:"#app",
            data:{
                val:"",
                vals:"",
                valss:""
            },
            methods: {
                
            }
          })
    </script>
</body>
</html>